#include <sys/socket.h>
#include <sys/types.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc,char *argv[])
{
    int sockfd;
    int len;
    struct  sockaddr_in address;
    int result;
    sockfd=socket(AF_INET,SOCK_STREAM,0);
    address.sin_family=AF_INET;
    address.sin_addr.s_addr=inet_addr(argv[1]);
    address.sin_port=atoi(argv[2]);
    len=sizeof(address);
    // printf("%s\n",argv[1]);
    // printf("%s\n",argv[2]);
    result=connect(sockfd,(struct  sockaddr *)&address,len);
    if(result==-1)
    {
        perror("连接失败！");
        return 1;
    }
    getchar();
}